function gouwuxx() {
    var gouwu = JSON.parse(localStorage.getItem("cartDatas"));
    var arrgou = '';
    var arrnum = 0;
    var arrnum2 = 0;
    var arrnum3 = 0;
    for (var v = 0; v < gouwu.length; v++) {
        arrgou += `
        <div class="cart-item">
        <div class="shop">
            <div class="cart-checkbox">
                <input type="checkbox" id="shopid_10693" name="checkShop" class="ui-checkbox CheckBoxShop">
                <label for="shopid_10693" class="ui-label-14">&nbsp;</label>
            </div>
            <div class="shop-txt">
                <a href="" class="shop-name" target="_blank"><strong>创造旗舰店</strong></a>
                <a id="IM" href="javascript:void(0);" class="p-kefu"><i
                        class="iconfont icon-kefu"></i></a>
            </div>
        </div>
        <div class="item-list ${gouwu[v].good_id}">
            <div class="item-single">
                <div class="item-item  selected">
                    <div class="item-form">
                        <div class="cell s-checkbox">
                            <div class="cart-checkbox">
                                <input type="checkbox" id="checkItem_44457" value="44457" name="checkItem" class="ui-checkbox" ectype="ckGoods" data-ruid="10693" data-actid="0">
                                <label class="ui-label-14">&nbsp;</label>
                            </div>
                        </div>
                        <div class="cell s-goods">
                            <div class="goods-item">
                                <div class="p-img">
                                    <a href="" target="_blank"><img src="${gouwu[v].good_urls.nowurl}" width="70" height="70"></a>
                                </div>
                                <div class="item-msg">
                                    <a href="" target="_blank">
                                    ${gouwu[v].goods_title}
                                    </a>
                                    <div class="gds-types">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="cell s-props">
                            &nbsp;
                        </div>
                        <div class="cell s-price">
                            <strong id="goods_price_44457">${gouwu[v].goods_price}</strong>
                        </div>
                        <div class="cell s-quantity">
                            <div class="amount-warp">
                                <input type="text" value="${gouwu[v].buy_num}" name="goods_number[44457]" id="goods_number_44457" class="text buy-num">
                                <div class="a-btn">
                                    <a href="javascript:void(0);" class="btn-add"><i
                                            class="iconfont icon-up"></i></a>
                                    <a href="javascript:void(0);" class="btn-reducebtn-disabled"><i
                                            class="iconfont icon-down"></i></a>
                                </div>
                            </div>
                            <div class="tc ftx-03">有货</div>
                        </div>
                        <div class="cell s-sum">
                            <strong id="goods_subtotal_44457">
                                <div id="_44457_subtotal">¥${Number(gouwu[v].goods_price.split('￥')[1]) * Number(gouwu[v].buy_num)}</div>
                            </strong>
                            <div class="cuttiphide">
                            </div>
                        </div>
                        <div class="cell s-action">
                            <a href="javascript:void(0);" class="cart-remove">删除</a>
                            <a href="javascript:void(0);" class="cart-store">收藏</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
            `;
        // 总共个数
        arrnum += Number(gouwu[v].buy_num);
        // 总价
        arrnum2 += Number(gouwu[v].goods_price.split('￥')[1]) * Number(gouwu[v].buy_num);
    };
    var youcegou2 = `
    <div class="cart-toolbar" ectype="tfoot-toolbar">
    <div class="w w1200">
        <div class="cart-checkbox cart-all-checkbox" ectype="ckList">
            <input type="checkbox" id="toggle-checkboxes-down" class="ui-checkbox checkboxshopAll" ectype="ckAll">
            <label for="toggle-checkboxes-down" class="ui-label-14">全选</label>
        </div>
        <div class="operation">
            <a href="javascript:void(0);" class="cart-remove-batch">删除选中的商品</a>
            <a href="javascript:void(0);" class="cart-follow-batch">移到我的收藏</a>
        </div>
        <div class="toolbar-right">
            <div class="comm-right">
                <div class="btn-area">
                    <form name="formCart" >
                        <input name="goPay" type="submit" class="submit-btn" value="去支付" id="go_pay">
                    </form>
                </div>
                <div class="price-sum" id="total_desc">
                    <span class="txt">总价(不含运费)：</span>
                    <span class="price sumPrice" id="cart_goods_amount">¥${arrnum2}</span>
                    <span class="txt" id="rate_desc" style="display:none;">税费：</span>
                    <span class="price sumPrice"><em id="cart_total_rate"
                            style="display:none;"></em></span>
                </div>
                <div class="reduce-sum">
                    <span class="txt">已节省：</span>
                    <span class="price totalRePrice" id="save_total_amount">¥0.00</span>
                </div>
                <div class="amount-sum">已选择<em class="cart_check_num">${arrnum}</em>件商品
                </div>
            </div>
        </div>
    </div>
</div>`;
    $('.cart-tbody').html(arrgou);
    $('.cart-tfoot').html(youcegou2);
    $('.cartNum').text(arrnum);

    $('.cart-remove').click(function(e) {
        pb_mask.className = '';
        $('.pb-ok').click(function() {
            pb_x.onclick();
            $(e.target).parents('.item-list').remove();
            var namex = $(e.target).parents('.item-list').attr('class');
            var namer = namex.split(' ')[1];
            console.log(namer);
            var namexx = '';
            for (var d = 0; d < gouwu.length; d++) {
                if (gouwu[d].good_id == namer) {
                    namexx = gouwu[d].good_id;
                    gouwu.splice(d, 1);
                }
            };
            localStorage.setItem("cartDatas", JSON.stringify(gouwu));
            gouwuxx();
        });

    });
}
gouwuxx();













// 蒙版消失隐藏
var cart_remove = document.querySelector('.cart-remove');
var pb = document.querySelector('.pb');
var pb_x = document.querySelector('.pb-x');
var pb_mask = document.querySelector('#pb-mask');
cart_remove.onclick = function() {
    pb.className = 'pb show';
    pb_mask.className = 'show';
}
pb_x.onclick = function() {
    pb.className = 'pb hide';
    pb_mask.className = '';
};